package com.logistics.controller.platform;

import com.logistics.common.Result;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * 平台管理端 - Dashboard 控制器
 */
@RestController
@RequestMapping("/platform/dashboard")
public class PlatformDashboardController {
    
    /**
     * 获取平台统计数据
     */
    @GetMapping("/stats")
    @PreAuthorize("hasRole('PLATFORM_ADMIN')")
    public Result<Map<String, Object>> getStats() {
        Map<String, Object> stats = new HashMap<>();
        stats.put("totalTenants", 502);
        stats.put("activeTenants", 468);
        stats.put("totalOrders", 1258650);
        stats.put("todayOrders", 3856);
        return Result.success(stats);
    }
}

